package com.mark.springsecurity.dto.req.vo;

import com.mark.springsecurity.domain.SysRole;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SysRoleVo {

    private Long id;
    private String name;

    public static SysRole buildSysRole(SysRoleVo sysRoleVo) {
        return SysRole.builder()
                .id(sysRoleVo.getId())
                .build();
    }

    public static SysRoleVo build(SysRole sysRole) {
        return SysRoleVo.builder()
                .id(sysRole.getId())
                .name(sysRole.getName())
                .build();
    }
}
